home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / internet / iphijack.txt < prev    next >
Text File  |  1996-04-26  |  46KB  |  1,056 lines

  1.  
  2.                 Simple Active Attack Against TCP
  3.  
  4.                         Laurent Joncheray
  5.  
  6.                         Merit Network, Inc.
  7.                         4251 Plymouth Road, Suite C
  8.                         Ann Arbor, MI 48105, USA
  9.                         Phone: +1 (313) 936 2065
  10.                         Fax: +1 (313) 747 3185
  11.                         E-mail: lpj@merit.edu
  12.  
  13.                         Abstract
  14.  
  15.         This paper describes an active attack against the Transport
  16. Control Protocol (TCP) which allows a cracker to redirect the TCP
  17. stream through his machine thereby permitting him to bypass the protection
  18. offered by such a system as a one-time password [skey] or
  19. ticketing authentication [kerberos]. The TCP connection is
  20. vulnerable to anyone with a TCP packet sniffer and generator located on
  21. the path followed by the connection. Some schemes to detect this
  22. attack are presented as well as some methods of prevention and some
  23. interesting details of the TCP protocol behaviors.
  24.  
  25. 1. Introduction
  26.  
  27.         Passive attacks using sniffers are becoming more and more
  28. frequent on the Internet. The attacker obtains a user id and password
  29. that allows him to logon as that user. In order to prevent such attacks
  30. people have been using identification schemes such as one-time password
  31. [skey] or ticketing identification [kerberos]. Though
  32. they prevent password sniffing on an unsecure network these methods
  33. are still vulnerable to an active attack as long as they neither
  34. encrypt nor sign the data stream. [Kerberos also provides an
  35. encrypted TCP stream option.] Still many people are complacent believing
  36. that active attacks are very difficult and hence a lesser risk.
  37.  
  38.         The following paper describes an extremely simple active attack
  39. which has been successfully used to break into Unix hosts and
  40. which can be done with the same resources as for a passive sniffing
  41. attack. [The attacks have been performed with a test software
  42. and the users were aware of the attack.  Although we do not have any
  43. knowledge of such an attack being used on the Internet, it may
  44. be possible.] Some uncommon  behaviors of the TCP protocol are also
  45. presented as well as some real examples and statistical studies of the
  46. attack's impact on the network.  Finally some detection and prevention
  47. schemes are explained. In order to help any reader unfamiliar with the
  48. subtleties of the TCP protocol the article starts with a short
  49. description of TCP.
  50.  
  51.         The reader can also refers to another attack by R. Morris
  52. presented in [morris85]. Though the following attack is related
  53. to Morris' one, it is more widely usable on any TCP connection.
  54. In section 7 we present and compare this attack with
  55. the present one.
  56.  
  57.         The presentation of the attack will be divided into three parts:
  58. the ``Established State'' which is the state where the session is open
  59. and data is exchanged; the set up (or opening) of such a session; and
  60. finally some real examples.
  61.  
  62. 2. Established State
  63.  
  64. 2.1 The TCP protocol
  65.  
  66.         This section offers a short description of the TCP protocol.
  67. For more details the reader can refer to [rfc793]. TCP provides a
  68. full duplex reliable stream connection between two end points. A
  69. connection is uniquely defined by the quadruple (IP address of sender,
  70. TCP port number of the sender, IP address of the receiver, TCP port
  71. number of the receiver). Every byte that is sent by a host is marked with a
  72. sequence number (32 bits integer) and is acknowledged by the receiver
  73. using this sequence number. The sequence number for the first byte sent
  74. is computed during the connection opening. It changes for any new
  75. connection based on rules designed to avoid reuse of the same sequence
  76. number for two different sessions of a TCP connection.
  77.  
  78.         We shall assume in this document that one point of the
  79. connection acts as a server (for instance a telnet server) and the
  80. other as the client.  The following terms will be used:
  81.  
  82.         SVR_SEQ: sequence number of the next byte to be sent
  83.         by the server;
  84.         SVR_ACK: next byte to be received by the server
  85.         (the sequence number of the last byte received plus one);
  86.         SVR_WIND: server's receive window;
  87.         CLT_SEQ: sequence number of the next byte to be sent by
  88.         the client;
  89.         CLT_ACK: next byte to be received by the client;
  90.         CLT_WIND: client's receive window;
  91.  
  92.         At the beginning when no data has been exchanged we have
  93. SVR_SEQ = CLT_ACK and CLT_SEQ = SVR_ACK. These equations
  94. are also true when the connection is in a 'quiet' state (no data being
  95. sent on each side).  They are not true during transitory states when
  96. data is sent.  The more general equations are:
  97.  
  98.         CLT_ACK <= SVR_SEQ <= CLT_ACK + CLT_WIND
  99.         SVR_ACK <= CLT_SEQ <= SVR_ACK + SVR_WIND
  100.  
  101. The TCP packet header fields are:
  102.  
  103.         Source Port:            The source port number;
  104.         Destination Port:       The destination port number;
  105.         Sequence number:        The sequence number of the first
  106.                                 byte in this packet;
  107.         Acknowledgment Number:  The expected sequence number
  108.                                         of the next byte to be received;
  109.         Data Offset:            Offset of the data in the packet;
  110.         Control Bits:
  111.  
  112.                 URG:  Urgent Pointer;
  113.                 ACK:  Acknowledgment;
  114.                 PSH:  Push Function;
  115.                 RST:  Reset the connection;
  116.                 SYN:  Synchronize sequence numbers;
  117.                 FIN:  No more data from sender;
  118.  
  119.         Window:         Window size of the sender;
  120.         Checksum:       TCP checksum of the header and data;
  121.         Urgent Pointer: TCP urgent pointer;
  122.         Options:                TCP options;
  123.  
  124.  - SEG_SEQ will refer to the packet sequence number (as
  125. seen in the header).
  126.  - SEG_ACK will refer to the packet acknowledgment number.
  127.  - SEG_FLAG will refer to the control bits.
  128.  
  129. On a typical packet sent by the client (no retransmission) SEG_SEQ is set
  130. to CLT_SEQ, SEG_ACK to CLT_ACK.
  131.  
  132.         TCP uses a ``three-way handshake'' to establish a new
  133. connection. If we suppose that the client initiates the connection to
  134. the server and that no data is exchanged, the normal packet exchange
  135. is (C.f. Figure 1):
  136.  
  137.  - The connection on the client side is on the CLOSED state.
  138. The one on the server side is on the LISTEN state.
  139.  - The client first sends its initial sequence number and sets the SYN bit:
  140.  
  141.         SEG_SEQ  =  CLT_SEQ_0,
  142.         SEG_FLAG  =  SYN
  143.  
  144. Its state is now SYN-SENT
  145.  - On receipt of this packet the server acknowledges the client sequence
  146. number, sends its own initial sequence number and sets the SYN bit:
  147.  
  148.         SEG_SEQ  =  SVR_SEQ_0,
  149.         SEQ_ACK  =  CLT_SEQ_0+1,
  150.         SEG_FLAG  =  SYN
  151.  
  152. and set
  153.  
  154.         SVR_ACK=CLT_SEQ_0+1
  155.  
  156. Its state is now SYN-RECEIVED
  157.  - On receipt of this packet the client acknowledges the server
  158. sequence number:
  159.  
  160.         SEG_SEQ  =  CLT_SEQ_0+1,
  161.         SEQ_ACK  =  SVR_SEQ_0+1
  162.  
  163. and sets CLT_ACK=SVR_SEQ_0+1
  164. Its state is now ESTABLISHED
  165.  - On receipt of this packet the server enters the ESTABLISHED state. We now
  166. have:
  167.  
  168.         CLT_SEQ  =  CLT_SEQ_0+1
  169.         CLT_ACK  =  SVR_SEQ_0+1
  170.         SVR_SEQ  =  SVR_SEQ_0+1
  171.         SVR_ACK  =  CLT_SEQ_0+1
  172.  
  173. Server                                          Client
  174. LISTEN                                          CLOSED
  175.  
  176.                     <-  SYN,
  177.                         CLT_SEQ_0
  178.  
  179. LISTEN                                          SYN-SENT
  180.  
  181.                         SYN,        ->
  182.                         SVR_SEQ_0,
  183.                         CLT_SEQ_0+1
  184.  
  185. SYN-RECEIVED                                    ESTABLISHED
  186.  
  187.                                                 SVR_SEQ = CLT_SEQ_0 + 1
  188.                                                 CLT_ACK = SVR_SEQ_0 + 1
  189.  
  190.                     <-  ACK,
  191.                         CLT_SEQ_0 + 1
  192.                         SVR_SEQ_0+1
  193.  
  194. ESTABLISHED
  195.  
  196. SVR_SEQ = SVR_SEQ_0 + 1
  197. SVR_ACK = CLT_SEQ_0 + 1
  198.  
  199.  
  200.                 figure 1: Example of a connection opening
  201.  
  202.         Closing a connection can be done by using the FIN or the RST
  203. flag.  If the RST flag of a packet is set the receiving host enters the
  204. CLOSED state and frees any resource associated with this instance of
  205. the connection.  The packet is not acknowledged. Any new incoming
  206. packet for that connection will be dropped.
  207.  
  208. If the FIN flag of a packet is set the receiving host enters the
  209. CLOSE-WAIT state and starts the process of gracefully closing the
  210. connection.  The detail of that procces is beyond the scope of this
  211. document. The reader can refer to [rfc793] for further details.
  212.  
  213.         In the preceding example we specifically avoided any unusual cases
  214. such as out-of-band packets, retransmission, loss of packet, concurrent
  215. opening, etc...  These can be ignored in this simple study of the
  216. attack.
  217.  
  218.         When in ESTABLISHED state, a packet is acceptable if its
  219. sequence number falls within the expected segment
  220.  
  221.         [SVR_ACK, SVR_ACK + SVR_WIND]
  222.  
  223. (for the server) or
  224.  
  225.         [CLT_ACK, CLT_ACK + CLT_WIND]
  226.  
  227. (for the client). If the sequence number is beyond those limits the
  228. packet is dropped and a acknowledged packet will be sent using the
  229. expected sequence number.  For example if
  230.  
  231.         SEG_SEQ  =  200,
  232.         SVR_ACK  =  100,
  233.         SVR_WIND  =  50
  234.  
  235. Then SEG_SEQ > SVR_ACK + SVR_WIND. The server
  236. forms a ACK packet with
  237.  
  238.         SEG_SEQ  =  SVR_SEQ
  239.         SEG_ACK  =  SVR_ACK
  240.  
  241. which is what the server expects to see in the packet.
  242.  
  243. 2.2 A desynchronized state
  244.  
  245.         The term ``desynchronized state'' will refer to the connection
  246. when both sides are in the ESTABLISHED state, no data is being sent
  247. (stable state), and
  248.  
  249.         SVR_SEQ  !=  CLT_ACK
  250.         CLT_SEQ  !=  SVR_ACK
  251.  
  252.  
  253.         This state is stable as long as no data is sent. If some data
  254. is sent two cases can occur:
  255.  
  256.  - If CLT_SEQ < SVR_ACK + SVR_WIND and
  257. CLT_SEQ > SVR_ACK the packet is acceptable, the data may be stored
  258. for later use (depending on the implementation) but not sent to the
  259. user since the beginning of the stream (sequence number SVR_ACK) is
  260. missing.
  261.  - If CLT_SEQ > SVR_ACK + SVR_WIND or CLT_SEQ <
  262. SVR_ACK the packet is not acceptable and will be dropped. The data is
  263. lost.
  264.  
  265.         In both case data exchange is not possible even if the state
  266. exists.
  267.  
  268. 2.3 The attack
  269.  
  270.         The proposed attack consists of creating a desynchronized state
  271. on both ends of the TCP connection so that the two points cannot exchange data
  272. any longer. A third party host is then used to create acceptable packets
  273. for both ends which mimics the real packets.
  274.  
  275.         Assume that the TCP session is in a desynchronized state and that
  276. the client sends a packet with
  277.  
  278.         SEG_SEQ  =  CLT_SEQ
  279.         SEG_ACK  =  CLT_ACK
  280.  
  281. Since CLT_SEQ != SVR_ACK the data will not be accepted and the
  282. packet is dropped.  The third party then sends the same packet but
  283. changes the SEG_SEQ and SEG_ACK (and the checksum) such that
  284.  
  285.         SEG_SEQ  =  SVR_ACK,
  286.         SEG_ACK  =  SVR_SEQ
  287.  
  288. which is acceptable by the server. The data is processed by the server.
  289.  
  290. If CLT_TO_SVR_OFFSET refers to SVR_ACK - CLT_SEQ and
  291. SVR_TO_CLT_OFFSET refers to CLT_ACK - SVR_SEQ then the first party
  292. attacker has to rewrite the TCP packet from the client to the server as:
  293.  
  294.         SEG_SEQ <- SEG_SEQ + CLT_TO_SVR_OFFSET
  295.         SEG_ACK <- SEG_ACK - SVR_TO_CLT_OFFSET
  296.  
  297. Considering that the attacker can listen to any packet exchanged between
  298. the two points and can forge any kind of IP packet (therefore masquerading as
  299. either the client or the server) then everything acts as if the connection
  300. goes through the attacker machine. This one can add or remove any data to
  301. the stream. For instance if the connection is a remote login using telnet
  302. the attacker can include any command on behalf of the user
  303. ("echo merit.edu lpj > ~/.rhosts" is an example of such a command)
  304. and filter out any unwanted echo so that the user will not
  305. be aware of the intruder.
  306. Of course in this case CLT_TO_SVR_OFFSET and SVR_TO_CLT_OFFSET
  307. have to change. The new values are let as an exercise for the
  308. reader. [One can turn off
  309. the echo in the telnet connection in order to avoid the burden of filtering
  310. the output. The test we did showed up a bug in the current telnet
  311. implementation (or maybe in the telnet protocol itself). If a TCP packet
  312. contains both
  313. IAC DONT ECHO and IAC DO ECHO the telnet processor will answer with
  314. IAC WONT ECHO and IAC WILL ECHO. The other end point will acknowledge
  315. IAC DONT ECHO and IAC DO ECHO etc... creating an endless loop.]
  316.  
  317. 2.4 ``TCP Ack storm''
  318.  
  319.         A flaw of the attack is the generation of a lot of TCP ACK
  320. packets. When receiving an unacceptable packet the host acknowledges it
  321. by sending the expected sequence number (As the Acknolegement number.
  322. C.f. introduction about TCP)
  323. and using its own sequence number. This packet is itself unacceptable and
  324. will generate an acknowledgement packet which in turn will generate
  325. an acknowledgement packet etc... creating a supposedly endless loop for
  326. every data packet sent.
  327.  
  328.         Since these packets do not carry data they are not retransmitted
  329. if the packet is lost. This means that if one of the packets
  330. in the loop is dropped then the loop ends. Fortunately (or
  331. unfortunately?) TCP uses IP on an unreliable network layer with a non
  332. null packet loss rate, making an end to the loops. Moreover the more
  333. packets the network drops, the shorter is the Ack storm (the loop). We
  334. also notice that these loops are self regulating: the more loops we
  335. create the more traffic we get, the more congestion and packet drops we
  336. experience and the more loops are killed.
  337.  
  338.         The loop is created each time the client or the server sends data.
  339. If no data is sent no loop appears. If data is sent and no attacker is there
  340. to acknowledge the data then the data will be retransmitted, a storm
  341. will be created for each retransmission, and eventually the connection
  342. will be dropped since no ACK of the data is sent. If the attacker acknowledges
  343. the data then only one storm is produced (in practice the attacker often
  344. missed the data packet due to the load on the network, and acknowledge the
  345. first of subsequent retransmission).
  346.  
  347.         The attack uses the second type of packet described in
  348. Section 2.2. The first case in which the data is stored by
  349. the receiver for later processing has not been tested. It has the
  350. advantage of not generating the ACK storm but on the other hand it may be
  351. dangerous if the data is actually processed. It is also difficult to
  352. use with small window connections.
  353.  
  354. 3. Setup of the session
  355.  
  356.         This paper presents two methods for desynchronizing a TCP connection.
  357. Others can be imagined but will not be described here. We suppose that the
  358. attacker can listen to every packet sent between the two end points.
  359.  
  360. 3.1 Early desynchronization
  361.  
  362. This method consists of breaking the connection in its early setup stage
  363. on the server side and creating a new one with different sequence number.
  364. Here is the process (Figure 2 summarizes this process)
  365.  
  366.          - The attacker listens for a SYN/ACK packet from the server to
  367. the client (stage 2 in the connection set up).
  368.  
  369.          - On detection of that packet the attacker sends the server
  370. a RST packet and then a SYN packet with exactly the same parameters
  371. (TCP port) but a different sequence number (referred to as ATK_ACK_0 in
  372. the rest of the paper).
  373.  
  374.          - The server will close the first connection when it
  375. receives the RST packet and then reopens a new one on the same port but
  376. with a different sequence number (SVR_SEQ_0') on receipt of the SYN
  377. packet. It sends back a SYN/ACK packet to the client.
  378.  
  379.          - On detection of that packet the attacker sends the server a
  380. ACK packet. The server switches to the ESTABLISHED state.
  381.  
  382.          - The client has already switched to the ESTABLISHED state when it
  383. receives the first SYN/ACK packet from the server.
  384.  
  385.  
  386. Server                                          Client
  387.                                                                 
  388. LISTEN                                          CLOSED
  389.  
  390.                     <-  SYN,
  391.                         CLT_SEQ_0
  392.  
  393. SYN-RECEIVED                                    SYN-SENT
  394.  
  395.                         SYN,         ->
  396.                         SVR_SEQ_0,
  397.                         CLT_SEQ_0+1
  398.                 
  399.  
  400.                                                 ESTABLISHED
  401.                                         
  402.                                                 SVR_SEQ = CLT_SEQ_0 + 1
  403.                                                 CLT_ACK = SVR_SEQ_0 + 1
  404.                                         
  405.                     <=  RST,
  406.                         CLT_SEQ_0 + 1
  407.                 
  408. CLOSED
  409.  
  410.                     <=  SYN,
  411.                         ATK_SEQ_0
  412.                 
  413.  
  414.                         SYN,           ->
  415.                         SVR_SEQ_0',
  416.                         ATK_SEQ_0 + 1
  417.  
  418. SYN-RECEIVED
  419.  
  420.                     <=  SYN,
  421.                         ATK_SEQ_0 + 1,
  422.                         SVR_SEQ_0' + 1
  423.                 
  424.  
  425. ESTABLISHED
  426.  
  427. SVR_SEQ = SVR_SEQ_0' + 1
  428. SVR_ACK = ATK_SEQ_0 + 1
  429.  
  430.  
  431.         Figure 2: A attack scheme. The attacker's packets are marked with <=
  432.  
  433.         This diagram does not show the unacceptable acknowledgement packet
  434. exchanges. Both ends are in the desynchronized ESTABLISHED state now.
  435.  
  436.         SVR_TO_CLT_OFFSET = SVR_SEQ_0 - SVR_SEQ_0'
  437.  
  438. is fixed by the server.
  439.  
  440.         CLT_TO_SVR_OFFSET = ATK_SEQ_0 - CLT_SEQ_0
  441.  
  442. is fixed by the attacker.
  443.  
  444.         The success of the attack relies on the correct value being chosen
  445. for CLT_TO_SVR_OFFSET. Wrong value may make the
  446. client's packet acceptable and can produce unwanted effects.
  447.  
  448. 3.2 Null data desynchronization
  449.  
  450.         This method consists for the attacker in sending a large amount
  451. of data to the server and to the client. The data sent shouldn't affect
  452. nor be visible to the client or sever, but will put both end of the TCP
  453. session in the desynchronized state.
  454.  
  455.         The following scheme can be used with a telnet session:
  456.  
  457.          - The attacker watchs the session without interfering.
  458.          - When appropriate the attacker sends a large amount of ``null
  459. data'' to the server. ``Null data'' refers to data that will not affect
  460. anything on the server side besides changing the TCP acknowledgment number.
  461. [For instance with a telnet session the attacker sends ATK_SVR_OFFSET
  462. bytes consisting of the sequence IAC NOP IAC NOP... Every two
  463. bytes IAC NOP will be interpreted by the telnet daemon, removed from
  464. the stream of data and nothing will be affected. [The telnet
  465. protocol [telnet] defines the NOP command as ``No Operation''. In
  466. other words, do nothing, just ignore those bytes.] Now the Server has
  467.  
  468.         SVR_ACK = CLT_SEQ + ATK_SVR_OFFSET
  469.  
  470. which of course is desynchronized.
  471.          - The attacker does the same thing with the client.
  472.  
  473.  
  474.         The method is useful if the session can carry ``null data''. The
  475. time when the attacker sends that data is also very difficult to determine
  476. and may cause some unpredictable side effects.
  477.  
  478. 4. Examples
  479.  
  480.         The following logs are provided by running a hacked version of
  481. tcpdump [tcpdump] on the local ethernet where the client resides.
  482. Comments are preceded by `##'.
  483.  
  484.         The first example is a normal telnet session opening between 35.42.1.56
  485. (the client) and 198.108.3.13 (the server).
  486.  
  487.         ## The client sends a SYN packet, 1496960000 is its initial sequence nu
  488. mber.
  489. 11:07:14.934093 35.42.1.56.1374 > 198.108.3.13.23: S 1496960000:1496960000(0) w
  490. in 4096
  491.         ## The server answers with its initial sequence number and the SYN flag
  492. .
  493. 11:07:14.936345 198.108.3.13.23 > 35.42.1.56.1374: S 1402880000:1402880000(0) a
  494. ck 1496960001 win 4096
  495.         ## The client acknowledges the SYN packet.
  496. 11:07:14.937068 35.42.1.56.1374 > 198.108.3.13.23: . 1496960001:1496960001(0) a
  497. ck 1402880001 win 4096
  498.         ## Now the two end points are in the ESTABLISHED state.
  499.         ## The client sends 6 bytes of data.
  500. 11:07:15.021817 35.42.1.56.1374 > 198.108.3.13.23: P 1496960001:1496960007(6)
  501.         ack 1402880001 win 4096 255 253 /C 255 251 /X
  502. [...
  503.         ## The rest of the log is the graceful closing of the connection
  504. 11:07:18.111596 198.108.3.13.23 > 35.42.1.56.1374: F 1402880059:1402880059(0) a
  505. ck 1496960025 win 4096
  506. 11:07:18.112304 35.42.1.56.1374 > 198.108.3.13.23: . 1496960025:1496960025(0) a
  507. ck 1402880060 win 4096
  508. 11:07:18.130610 35.42.1.56.1374 > 198.108.3.13.23: F 1496960025:1496960025(0) a
  509. ck 1402880060 win 4096
  510. 11:07:18.132935 198.108.3.13.23 > 35.42.1.56.1374: . 1402880060:1402880060(0) a
  511. ck 1496960026 win 4095
  512.  
  513.         The next example is the same session with an intrusion by the
  514. attacker. The desynchronized state is created in the early stage of
  515. the session (subsection 3.1). The attacker will add the
  516. command 'ls;' to the stream of data.  The user uses skey to
  517. identify himself to the server. From the user's point of view the
  518. session looks like this:
  519.  
  520. <lpj@homefries: 1> telnet 198.108.3.13
  521. Trying 198.108.3.13 ...
  522. Connected to 198.108.3.13.
  523. Escape character is '^'.
  524.  
  525. SunOS UNIX (_host)
  526.  
  527. login: lpj
  528. s/key 70 cn33287
  529. (s/key required)
  530. Password:
  531. Last login: Wed Nov 30 11:28:21 from homefries.merit.edu
  532. SunOS Release 4.1.3_U1 (GENERIC) #2: Thu Jan 20 15:58:03 PST 1994
  533. (lpj@_host: 1) pwd
  534. Mail/           mbox            src/
  535. elm*            resize*         traceroute*
  536. /usr/users/lpj
  537. (lpj@_host: 2) history
  538.      1  13:18   ls ; pwd
  539.      2  13:18   history
  540. (lpj@_host: 3) logoutConnection closed by foreign host.
  541. <lpj@homefries: 2>
  542.  
  543. The user types only one command 'pwd' and then asks for the history of
  544. the session. The history shows that a ls' has also being issued.
  545. The ls command produces an output which has not been filtered.
  546. The following log shows the TCP packet exchanges between the client and
  547. the server. Unfortunately some packets are missing from this log because
  548. they have been dropped by the sniffer's ethernet interface driver. One
  549. must see that log like a snapshot of a few instants of the exchange
  550. more than the full transaction log. The attacker's window size has been
  551. set to uncommon values (400, 500, 1000) in order to make its packets
  552. more easily traceable. The attacker is on 35.42.1, three hops away from the
  553. server, on the path from the client to the server. The names and addresses
  554. of the hosts have been changed for security reasons.
  555.  
  556.         ## The client sends a SYN packet, 896896000 is its initial sequence num
  557. ber.
  558. 11:25:38.946119 35.42.1.146.1098 > 198.108.3.13.23: S 896896000:896896000(0) wi
  559. n 4096
  560.         ## The server answers with its initial sequence number (1544576000) and
  561.  the SYN flag.
  562. 11:25:38.948408 198.108.3.13.23 > 35.42.1.146.1098: S 1544576000:1544576000(0)
  563. ack 896896001 win 4096
  564.         ## The client acknowledges the SYN packet. It is in the ESTABLISHED sta
  565. te now.
  566. 11:25:38.948705 35.42.1.146.1098 > 198.108.3.13.23: . 896896001:896896001(0) ac
  567. k 1544576001 win 4096
  568.         ## The client sends some data
  569. 11:25:38.962069 35.42.1.146.1098 > 198.108.3.13.23: P 896896001:896896007(6)
  570.         ack 1544576001 win 4096 255 253 /C 255 251 /X
  571.         ## The attacker resets the connection on the server side
  572. 11:25:39.015717 35.42.1.146.1098 > 198.108.3.13.23: R 896896101:896896101(0) wi
  573. n 0
  574.         ## The attacker reopens the connection with an initial sequence number
  575. of 601928704
  576. 11:25:39.019402 35.42.1.146.1098 > 198.108.3.13.23: S 601928704:601928704(0) wi
  577. n 500
  578.         ## The server answers with a new initial sequence number (1544640000) a
  579. nd the SYN flag.
  580. 11:25:39.022078 198.108.3.13.23 > 35.42.1.146.1098: S 1544640000:1544640000(0)
  581. ack 601928705 win 4096
  582.         ## Since the last packet is unacceptable for the client, it acknowledge
  583. s it
  584.         ## with the expected sequence number (1544576001)
  585. 11:25:39.022313 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  586. k 1544576001 win 4096
  587.         ## Retransmission to the SYN packet triggered by the unacceptable last
  588. packet
  589. 11:25:39.023780 198.108.3.13.23 > 35.42.1.146.1098: S 1544640000:1544640000(0)
  590. ack 601928705 win 4096
  591.         ## The ACK storm loop
  592. 11:25:39.024009 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  593. k 1544576001 win 4096
  594. 11:25:39.025713 198.108.3.13.23 > 35.42.1.146.1098: S 1544640000:1544640000(0)
  595. ack 601928705 win 4096
  596. 11:25:39.026022 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  597. k 1544576001 win 4096
  598. [...
  599. 11:25:39.118789 198.108.3.13.23 > 35.42.1.146.1098: S 1544640000:1544640000(0)
  600. ack 601928705 win 4096
  601. 11:25:39.119102 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  602. k 1544576001 win 4096
  603. 11:25:39.120812 198.108.3.13.23 > 35.42.1.146.1098: S 1544640000:1544640000(0)
  604. ack 601928705 win 4096
  605. 11:25:39.121056 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  606. k 1544576001 win 4096
  607.         ## Eventually the attacker acknowledges the server SYN packet with the
  608. attacker's new
  609.         ## sequence number (601928705). The data in this packet is the one prev
  610. iously
  611.         ## sent by the client but never received.
  612. 11:25:39.122371 35.42.1.146.1098 > 198.108.3.13.23: . 601928705:601928711(6)
  613.         ack 1544640001 win 400 255 253 /C 255 251 /X
  614.         ## Some ACK storm
  615. 11:25:39.124254 198.108.3.13.23 > 35.42.1.146.1098: . 1544640001:1544640001(0)
  616. ack 601928711 win 4090
  617. 11:25:39.124631 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  618. k 1544576001 win 4096
  619. 11:25:39.126217 198.108.3.13.23 > 35.42.1.146.1098: . 1544640001:1544640001(0)
  620. ack 601928711 win 4090
  621. 11:25:39.126632 35.42.1.146.1098 > 198.108.3.13.23: . 896896007:896896007(0) ac
  622. k 1544576001 win 4096
  623. [...
  624. 11:25:41.261885 35.42.1.146.1098 > 198.108.3.13.23: . 601928728:601928728(0) ac
  625. k 1544640056 win 1000
  626.         ## A retransmission by the client
  627. 11:25:41.422727 35.42.1.146.1098 > 198.108.3.13.23: P 896896018:896896024(6)
  628.         ack 1544576056 win 4096 255 253 /A 255 252 /A
  629. 11:25:41.424108 198.108.3.13.23 > 35.42.1.146.1098: . 1544640059:1544640059(0)
  630. ack 601928728 win 4096
  631. [...
  632. 11:25:42.323262 35.42.1.146.1098 > 198.108.3.13.23: . 896896025:896896025(0) ac
  633. k 1544576059 win 4096
  634. 11:25:42.324609 198.108.3.13.23 > 35.42.1.146.1098: . 1544640059:1544640059(0)
  635. ack 601928728 win 4096
  636.         ## The user ID second character.
  637. 11:25:42.325019 35.42.1.146.1098 > 198.108.3.13.23: P 896896025:896896026(1)
  638.         ack 1544576059 win 4096 p
  639. 11:25:42.326313 198.108.3.13.23 > 35.42.1.146.1098: . 1544640059:1544640059(0)
  640. ack 601928728 win 4096
  641. [...
  642. 11:25:43.241191 35.42.1.146.1098 > 198.108.3.13.23: . 601928731:601928731(0) ac
  643. k 1544640060 win 1000
  644.         ## Retransmission
  645. 11:25:43.261287 198.108.3.13.23 > 35.42.1.146.1098: P 1544640059:1544640061(2)
  646.         ack 601928730 win 4096 l p
  647. 11:25:43.261598 35.42.1.146.1098 > 198.108.3.13.23: . 896896027:896896027(0) ac
  648. k 1544576061 win 4096
  649. [...
  650. 11:25:43.294192 198.108.3.13.23 > 35.42.1.146.1098: . 1544640061:1544640061(0)
  651. ack 601928730 win 4096
  652. 11:25:43.922438 35.42.1.146.1098 > 198.108.3.13.23: P 896896026:896896029(3)
  653.         ack 1544576061 win 4096 j /M /@
  654. 11:25:43.923964 198.108.3.13.23 > 35.42.1.146.1098: . 1544640061:1544640061(0)
  655. ack 601928730 win 4096
  656. [...
  657. 11:25:43.957528 198.108.3.13.23 > 35.42.1.146.1098: . 1544640061:1544640061(0)
  658. ack 601928730 win 4096
  659.         ## The attacker rewrites the packet sent by the server containing the s
  660. key challenge
  661. 11:25:44.495629 198.108.3.13.23 > 35.42.1.146.1098: P 1544576064:1544576082(18)
  662.  
  663.         ack 896896029 win 1000 s / k e y   7 0   c n 3 3 2 8 7 /M /J
  664. 11:25:44.502533 198.108.3.13.23 > 35.42.1.146.1098: P 1544576082:1544576109(27)
  665.  
  666.         ack 896896029 win 1000 ( s / k e y   r e q u i r e d ) /M /J P a s s w
  667. o r d :
  668. 11:25:44.522500 35.42.1.146.1098 > 198.108.3.13.23: . 896896029:896896029(0) ac
  669. k 1544576109 win 4096
  670. [...
  671. 11:25:44.558320 198.108.3.13.23 > 35.42.1.146.1098: . 1544640109:1544640109(0)
  672. ack 601928733 win 4096
  673.         ## Beginning of the skey password sent by the user (client)
  674. 11:25:57.356323 35.42.1.146.1098 > 198.108.3.13.23: P 896896029:896896030(1)
  675.         ack 1544576109 win 4096 T
  676. 11:25:57.358220 198.108.3.13.23 > 35.42.1.146.1098: . 1544640109:1544640109(0)
  677. ack 601928733 win 4096
  678. [...
  679. 11:25:57.412103 198.108.3.13.23 > 35.42.1.146.1098: . 1544640109:1544640109(0)
  680. ack 601928733 win 4096
  681.         ## Echo of the beginning of the skey password sent by the server
  682. 11:25:57.412456 35.42.1.146.1098 > 198.108.3.13.23: P 601928733:601928734(1)
  683.         ack 1544640109 win 1000 T
  684. 11:25:57.412681 35.42.1.146.1098 > 198.108.3.13.23: . 896896030:896896030(0) ac
  685. k 1544576109 win 4096
  686. [...
  687. 11:25:57.800953 198.108.3.13.23 > 35.42.1.146.1098: . 1544640109:1544640109(0)
  688. ack 601928734 win 4096
  689.         ## The attacker rewrites the skey password packet
  690. 11:25:57.801254 35.42.1.146.1098 > 198.108.3.13.23: P 601928734:601928762(28)
  691.         ack 1544640109 win 1000 A U T   S H I M   L O F T   V A S E   M O O   R
  692.  I D /M /@
  693. 11:25:57.801486 35.42.1.146.1098 > 198.108.3.13.23: . 896896058:896896058(0) ac
  694. k 1544576109 win 4096
  695. [...
  696. 11:25:58.358275 35.42.1.146.1098 > 198.108.3.13.23: . 896896058:896896058(0) ac
  697. k 1544576109 win 4096
  698. 11:25:58.360109 198.108.3.13.23 > 35.42.1.146.1098: P 1544640263:1544640278(15)
  699.  
  700.         ack 601928762 win 4096 ( l p j @ _ r a d b :   1 )
  701. 11:25:58.360418 35.42.1.146.1098 > 198.108.3.13.23: . 896896058:896896058(0) ac
  702. k 1544576109 win 4096
  703. [...
  704. 11:26:00.919976 35.42.1.146.1098 > 198.108.3.13.23: . 896896058:896896058(0) ac
  705. k 1544576278 win 4096
  706.         ## The 'p' of the 'pwd' command typed by the user.
  707. 11:26:01.637187 35.42.1.146.1098 > 198.108.3.13.23: P 896896058:896896059(1)
  708.         ack 1544576278 win 4096 p
  709. 11:26:01.638832 198.108.3.13.23 > 35.42.1.146.1098: . 1544640278:1544640278(0)
  710. ack 601928762 win 4096
  711. [...
  712. 11:26:03.183200 35.42.1.146.1098 > 198.108.3.13.23: . 896896063:896896063(0) ac
  713. k 1544576280 win 4096
  714. 11:26:03.921272 35.42.1.146.1098 > 198.108.3.13.23: P 896896060:896896063(3)
  715.         ack 1544576280 win 4096 d /M /@
  716. 11:26:03.922886 198.108.3.13.23 > 35.42.1.146.1098: . 1544640283:1544640283(0)
  717. ack 601928767 win 4096
  718. [...
  719. 11:26:04.339186 35.42.1.146.1098 > 198.108.3.13.23: . 896896063:896896063(0) ac
  720. k 1544576280 win 4096
  721. 11:26:04.340635 198.108.3.13.23 > 35.42.1.146.1098: P 1544640288:1544640307(19)
  722.  
  723.         ack 601928770 win 4096 M a i l / /I /I m b o x /I /I s r c / /M /J
  724. 11:26:04.342872 198.108.3.13.23 > 35.42.1.146.1098: P 1544640307:1544640335(28)
  725.  
  726.         ack 601928770 win 4096 e l m * /I /I r e s i z e * /I /I t r a c e r o
  727. u t e * /M
  728.  /J
  729. 11:26:04.345480 35.42.1.146.1098 > 198.108.3.13.23: . 896896063:896896063(0) ac
  730. k 1544576280 win 4096
  731. 11:26:04.346791 198.108.3.13.23 > 35.42.1.146.1098: P 1544640335:1544640351(16)
  732.  
  733.         ack 601928770 win 4096 / u s r / u s e r s / l p j /M /J
  734. 11:26:04.347094 35.42.1.146.1098 > 198.108.3.13.23: . 896896063:896896063(0) ac
  735. k 1544576280 win 4096
  736. 11:26:04.348402 198.108.3.13.23 > 35.42.1.146.1098: P 1544640351:1544640366(15)
  737.  
  738.         ack 601928770 win 4096 ( l p j @ _ r a d b :   2 )
  739. 11:26:04.378571 35.42.1.146.1098 > 198.108.3.13.23: . 896896063:896896063(0) ac
  740. k 1544576280 win 4096
  741. [...
  742. 11:26:09.791045 35.42.1.146.1098 > 198.108.3.13.23: P 601928773:601928775(2)
  743.         ack 1544640369 win 1000 t o
  744. 11:26:09.794653 198.108.3.13.23 > 35.42.1.146.1098: P 1544640369:1544640371(2)
  745.         ack 601928775 win 4096 t o
  746. 11:26:09.794885 35.42.1.146.1098 > 198.108.3.13.23: . 896896068:896896068(0) ac
  747. k 1544576366 win 4096
  748. [...
  749. 11:26:12.420397 35.42.1.146.1098 > 198.108.3.13.23: P 896896068:896896072(4)
  750.         ack 1544576368 win 4096 r y /M /@
  751. 11:26:12.422242 198.108.3.13.23 > 35.42.1.146.1098: . 1544640371:1544640371(0)
  752. ack 601928775 win 4096
  753. [...
  754. 11:26:12.440765 35.42.1.146.1098 > 198.108.3.13.23: . 896896072:896896072(0) ac
  755. k 1544576368 win 4096
  756.         ## The 'ry' of the 'history' command sent by the client
  757. 11:26:16.420287 35.42.1.146.1098 > 198.108.3.13.23: P 896896068:896896072(4)
  758.         ack 1544576368 win 4096 r y /M /@
  759. 11:26:16.421801 198.108.3.13.23 > 35.42.1.146.1098: . 1544640371:1544640371(0)
  760. ack 601928775 win 4096
  761. [...
  762. 11:26:16.483943 35.42.1.146.1098 > 198.108.3.13.23: . 896896072:896896072(0) ac
  763. k 1544576368 win 4096
  764.         ## The same packet rewritten by the attacker.
  765. 11:26:16.505773 35.42.1.146.1098 > 198.108.3.13.23: P 601928775:601928779(4)
  766.         ack 1544640371 win 1000 r y /M /@
  767.         ## answer to the history command sent by the server. We can notice the
  768. 'ls ;' inclusion
  769.         ## before the 'pwd'
  770. 11:26:16.514225 198.108.3.13.23 > 35.42.1.146.1098: P 1544640371:1544640437(66)
  771.  
  772.         ack 601928779 win 4096 r y /M /@ /M /J           1 /I 1 1 : 2 8 /I l s
  773.   ;   p w
  774.         d /M /J           2 /I 1 1 : 2 8 /I /@ /@ /@ L /@ /@ /@ T . 220 167 168
  775.  /@ /G
  776.        /@ /@ /@ /X /@ /H 137 148 /@ /@
  777. 11:26:16.514465 35.42.1.146.1098 > 198.108.3.13.23: . 896896072:896896072(0) ac
  778. k 1544576368 win 4096
  779. [...
  780. 11:26:16.575344 35.42.1.146.1098 > 198.108.3.13.23: . 896896072:896896072(0) ac
  781. k 1544576368 win 4096
  782.         ## The same packet rewritten by the attacker.
  783. 11:26:16.577183 198.108.3.13.23 > 35.42.1.146.1098: P 1544576368:1544576434(66)
  784.  
  785.         ack 896896072 win 1000 r y /M /@ /M /J           1 /I 1 1 : 2 8 /I l s
  786.   ;   p w
  787. d /M /J           2 /I 1 1 : 2 8 /I /@ /@ /@ L /@ /@ /@ T . 220 167 168 /@ /H /
  788. @ /@ /@
  789.         /X /@ /H 137 148 /@ /@
  790. 11:26:16.577490 198.108.3.13.23 > 35.42.1.146.1098: . 1544640437:1544640437(0)
  791. ack 601928779 win 4096
  792. [...
  793.         ## The user log out.
  794. 11:26:20.236907 35.42.1.146.1098 > 198.108.3.13.23: P 601928781:601928782(1) ac
  795. k 1544640437 win 1000 g
  796. 11:26:20.247288 198.108.3.13.23 > 35.42.1.146.1098: . 1544576438:1544576438(0)
  797. ack 896896074 win 1000
  798. 11:26:20.253500 198.108.3.13.23 > 35.42.1.146.1098: P 1544576435:1544576436(1)
  799. ack 896896074 win 1000 o
  800. 11:26:20.287513 198.108.3.13.23 > 35.42.1.146.1098: P 1544640439:1544640440(1)
  801. ack 601928782 win 4096 g
  802. 11:26:20.287942 35.42.1.146.1098 > 198.108.3.13.23: P 896896075:896896076(1) ac
  803. k 1544576436 win 4096 o
  804. 11:26:20.289312 198.108.3.13.23 > 35.42.1.146.1098: . 1544640440:1544640440(0)
  805. ack 601928782 win 4096
  806. 11:26:20.289620 35.42.1.146.1098 > 198.108.3.13.23: . 896896076:896896076(0) ac
  807. k 1544576436 win 4096
  808.  
  809.         Almost all of the packets with the ACK flag set but with no
  810. data are acknowledgement of unacceptable packets. A lot of
  811. retransmission occurs due to the load on the network and on the
  812. attacker host created by the ACK storm. The real log (including all ACK
  813. packets) is about 3000 lines long whereas the one shown here has been
  814. stripped to about 100 lines. A lot of packets have also been lost and do
  815. not show up in this log. The data collected during the test shows that
  816. one real packet sent can generate between 10 and 300 empty Ack
  817. packets.  Those numbers are of course highly variable.
  818.  
  819. 5. Detection and Side Effects
  820.  
  821.         Several flaws of that attack can be used to detect it. Three will
  822. be described here but one can imagine some other ways to detect the intrusion.
  823.  
  824.  
  825.  - Desynchronized state detection.  By comparing the sequence
  826. numbers of both ends of the connection the user can tell if the
  827. connection is in the desynchronized state. This method is feasible if
  828. we assume that the sequence numbers can be transmitted through the TCP
  829. stream without being compromised (changed) by the attacker.
  830.  
  831.                         Local Ethernet                  Transit Ethernet
  832. Total TCP/s             80-100   (60-80)                1400  (87)
  833. Total Ack               25-75    (25-45)                500   (35)
  834. Total Telnet            10-20    (10-25)                140   (10)
  835. Total Telnet Ack        5-10     (45-55)                45    (33)
  836.  
  837.         Table 1: Percentage of ACK packets without the attack.
  838.  
  839.  - Ack storm detection.
  840.         Some statistics on the TCP traffic conducted on our local
  841. ethernet segment outside the attack show that the average ratio of ACK
  842. without data packets per total telnet packets is around 45%. On a more
  843. loaded transit ethernet the average is about 33% (C.f Table 1)
  844.  
  845.         The total number of TCP packets as well as the total number of
  846. ACK and telnet packets fluctuate a lot on the local ethernet. The table shows
  847. the limits. The percentage of ACK telnet packets is very stable, around 45%.
  848. This can be explained by the fact that the telnet session is an interactive
  849. session and every character typed by the user must be echoed and acknowledged.
  850. The volume of exchanged data is very small each packet usually contains one
  851. character or one text line.
  852.  
  853.         The data for the transit ethernet is very consistent. Due to the
  854. high load on that segment a few packets may have been dropped by the
  855. collecting host.
  856.  
  857.         When the attack is conducted some of these figures change. The
  858. next table shows the results for two types of session. The data has been
  859. collected on the local ethernet only.
  860.  
  861.         In Table 2 the `Local connection' is a
  862. session with a host at a few IP hops from the client. The Round Trip
  863. Delay (RTD) is approximately 3ms and the actual number of hops is 4.
  864. The 'Remote connection' is a session with a RTD of about 40ms and 9
  865. hops away. In the first case the attack is clearly visible. Even if
  866. it's very fluctuant, the percentage of TCP ACK is near 100%. Almost
  867. all of the traffic is acknowledgement packets.
  868.  
  869.         In the second case the detection of the attack is less obvious.
  870. The data has to be compared with the first column of
  871. Table 1 (local traffic).  The percentage of TCP ACK
  872. slightly increases but not significantly.  One can explain this result
  873. by the long RTD which decreases the rate of ACK packets sent. The
  874. underlying network is also used to experience between a 5% and 10%
  875. packet loss which helps in breaking the ACK loop.
  876.  
  877.                         Local connection        Remote connection
  878. Total Telnet            80-400  (60-85)         30-40  (30-35)
  879. Total Telnet Ack        75-400  (90-99)         20-25  (60-65)
  880.  
  881.         Percentage of ACK packets during an attack.
  882.  
  883.          - Increase of the packet loss and retransmission for that
  884. particular session. Though no data is available to enlighten us on that
  885. behavior the log produced during the attack shows an unusually high
  886. level of packet loss and so retransmission. Therefore this implies a
  887. deterioration of the response time for the user. The packet loss
  888. increase is caused by:
  889.         
  890.          - The extra load of the network due to the ACK storms.
  891.          - The packet dropped by the sniffer of the attacker. The drops tend
  892.         to increase as the load on the network increases.
  893.  
  894.  - Some unexpected connection reset.
  895. The following behavior has not been fully investigated since the
  896. attacker program developed was to try the validity of the concept more
  897. than making the attack transparent to the client and server. These are
  898. likely to disappear with a more sophisticated attacker program. The user
  899. can experience a connection reset of its session at the early stage of
  900. the connection if the protocol of the attack is not correctly executed.
  901. A loss of the attacker's RST or SYN packets may leave the server side of the
  902. connection in a undefined state (usually CLOSED or SYN-RECEIVED) and
  903. may make the client packets acceptable. About 10% of the attacks performed
  904. were unsuccessful, ending either by a connection close (very visible)
  905. or a non-desynchronized connection (the attacker failed to redirect
  906. the stream).
  907.  
  908. Some side effects and notes about TCP and the attack.
  909.  
  910.          - TCP implementation.
  911.         The desynchronization process described here failed on certain
  912. TCP implementations. According to [rfc793] a RST packet is not
  913. acknowledged and just destroys the TCB. Some TCP implementations do
  914. when in a certain state acknowledge the RST packet by sending back a
  915. RST packet. When the attacker sends the RST packet to the server the
  916. RST is sent back to the client which closes its connection and ends the
  917. session. Other desynchronization mechanisms may be investigated which
  918. do not reset the connection.
  919.          - The client and the attacker were always on the same
  920. ethernet segment when performing the test. This makes the attack more
  921. difficult to run because of a high load on that segment. The collision
  922. rate increases and the attacker's sniffer buffer are overflowed by the
  923. traffic.
  924.          - One can think of just watching the session and
  925. sending some data to the server, without caring about creating the
  926. desynchronized state and forwarding the TCP packets. Though it will
  927. succeed in corrupting the host that approach is likely to be detected early
  928. by the user. Indeed the TCP session will not be able to exchange data
  929. once the command sent.
  930.  
  931. 6. Prevention
  932.         The only ways known by the writer currently available to prevent
  933. such an attack on a telnet session are the encrypted Kerberos scheme
  934. (application layer) or the TCP crypt implementation
  935. [TCPcrypt] (TCP layer).  Encryption of the data flow prevents any
  936. intrusion or modification of the content. Signature of the data can
  937. also be used. [pgp] is an example of an available way to secure
  938. electronic mail transmission.
  939.  
  940. 7. Morris' Attack Reviewed
  941.  
  942.         Morris' attack as described in [morris85] assumes that
  943. the attacker can predict the next initial sequence number used by the server
  944. (noted SVR_SEQ_0 in this document) and that the identification scheme is
  945. based on trusted hosts (which means only certain hosts are allowed
  946. to perform some commands on the server without any other identification
  947. process being needed).
  948.  
  949.          In this attack the cracker initiates the session
  950. by sending a SYN packet to the server using the client (trusted host)
  951. as the source address. The server acknowledge the SYN with a SYN/ACK
  952. packet with SEG_SEQ = SVR_SEQ_0. The attacker then acknowledges that packet
  953. in guessing SVR_SEQ_0. The cracker does not need to sniff the client packets
  954. as long as he can predict SVR_SEQ_0 in order to acknowledge it. This
  955. attack has two main flaws:
  956.  
  957.  - The client whom the attacker masquerades will receive the SYN/ACK packet
  958. from the server and then could generate a RST packet to the server
  959. since in the client's view no session yet exists. Morris supposes that
  960. one can stop the RST generation by either performing the attack when the
  961. client is down or by overflowing the client's TCP queue so the SYN/ACK
  962. packet will be lost.
  963.  - The attacker cannot receive data from the server. But he can send
  964. data which is sometime enough to compromise a host.
  965.  
  966.         The are four principal differences between Morris' attack and
  967. the present one:
  968.  
  969.  - Morris's relies on the trusted hosts identification scheme whereas
  970. the present attack lets the user conduct the identification stage of the
  971. connection.
  972.  - The present attack is a full duplex TCP stream. The attacker can
  973. send and receive data.
  974.  - The present attack uses the ethernet sniffer to predict (or just get)
  975. SVR_SEQ_0.
  976.  - The present attack can be used against any kind of host besides
  977. Unix hosts.
  978.  
  979.         Morris' attack can easily be extented in regard of the present attack:
  980.  
  981.  - The sniffer is used to get the server's initial sequence number. Morris'
  982. attack can then be performed against the server. The attacker do not need
  983. to wait for a client to connect.
  984.  - Considering that the client will not send RST packets (for example it is
  985. down) the attacker can establish a full duplex TCP connection
  986. with the server. It can send data and receive data on behalf of the client.
  987. Of course the cracker still has to pass the identification barrier. If the
  988. identification is based on trusted hosts (like NFS or rlogin)
  989. the cracker has full access to the host's services.
  990.  
  991.         Steven M. Bellovin in [bellovin89] also presents how ICMP
  992. packets can be used to disable one side of the connection. In this case
  993. the attacker gets full control of the session (people have referred
  994. to 'TCP session hijacking'), but this is too easily detected by the user.
  995.  
  996. 8. Conclusion
  997.  
  998.         Although easy to detect when used on a local network, the attack
  999. presented here is quite efficient on long distance, low bandwidth, high
  1000. delay networks (usually WAN). It can be carried with the same resources as
  1001. for a passive sniffing attack which have occurred so frequently on the Internet
  1002. .
  1003. This attack has also the dangerous advantage of being invisible to the user.
  1004. While cracking into a host on the Internet is becoming more and more
  1005. frequent, the stealthfulness of the attack is now a very important
  1006. parameter for the success of the attack and makes it more difficult to
  1007. detect.
  1008.  
  1009.         When everybody's attention in the Internet is focused on the
  1010. emerging new IPv6 protocol to replace the current IPv4, increasing
  1011. attacks and the need for secure systems press us to develop and use a
  1012. secure transport layer for the Internet community. Options should be
  1013. available to send signed and eventually encrypted data  to provide
  1014. privacy. And since the signature of the data implies reliability the
  1015. signature can be substituted to the current TCP checksum.
  1016.  
  1017.         This paper does not attempt to explain all cases
  1018. of active attacks using a sniffer. It is more a warning for people using
  1019. s/key or Kerberos against the danger of someone sniffing the ethernet.
  1020. It provides a few ideas and starting points which can be more deeply studied.
  1021. The method presented has been successfully used during our test even with
  1022. a very simple attacker's software.
  1023.  
  1024. [Bellovin89] "Security Problems in the TCP/IP
  1025.         Protocol Suite", Bellovin, S., Computer Communications Review,
  1026.         April 1989.
  1027.  
  1028. [Kerberos] "Kerberos: An Authentication Service for
  1029.         Open Network Systems", Steiner, J., Neuman, C., Schiller, J.,
  1030.         USENIX Conference Proceeding, Dallas, Texas, February 1989.
  1031.  
  1032. [Morris85] "A Weakness in the 4.2BSD UNIX TCP/IP
  1033.         Software", Morris, R., Computing Science Technical Report No 117,
  1034.         ATT Bell Laboratories, Murray Hill, New Jersey, 1985.
  1035.  
  1036. [PGP] Pretty Good Privacy Version 2.6.1, Philip
  1037.         Zimmermann, August 1994.
  1038.  
  1039. [RFC 793] Request For Comment 793,
  1040.         ``Transmission Control Protocol'', September 1981, J. Postel.
  1041.  
  1042. [RFC 854] Request For Comment 854,
  1043.         ``Telnet Protocol Specification'', May 1983, J. Postel,
  1044.         J. Reynolds
  1045.  
  1046. [SKEY] "The S/Key One-time Password System", Haller, N.,
  1047.         Proceeding of the Symposium on Network Distributed Systems,
  1048.         Security, Internet Society, San Diego, CA, February 1994.
  1049.  
  1050. [TCPcrypt] "Public Key Encryption Support for TCP",
  1051.         Joncheray, L., Work in progress, May 1995.
  1052.  
  1053. [TCPDUMP] tcpdump(8) Version 2.2.1, Van Jacobson,
  1054.         Craig Leres, Steven Berkeley, University of California, Berkeley, CA.
  1055.  
  1056.